@extends('user.base')
@section('content-header','Patient Information')
@section('content-body')
<section class="content">
	<div class="container-fluid">
		<div class="col-md-3">
			<div class="row">
				<div class="col-md-6">
					<img src="{{ asset('/img/avatar.png')}}" />
				</div>
				<div class="col-md-6">
					<h4>
						<strong>{{ $patient->first_name." ".$patient->last_name }}</strong>
					</h4>
					<p>
						<strong>Left: </strong>{{ $patient->eyesight_left}}
					</p>
					<p>
						<strong>Right: </strong>{{ $patient->eyesight_right}}
					</p>
					<a href="{{'/patient/info/'.$patient->id.'/edit'}}">
						<span>Edit</span>
					</a>
				</div>
			</div>
			<hr />
			<div id="patient_basic_info">
			</div>
		</div>
		<div id="caselist" class="col-md-9">
			<div class="padding border-bottom">
				<a href="{{ URL('patient/patient/'.$patient->id.'/case/create')}}" class="btn btn-success btn-large">
					Add New Case
				</a>
			</div>
			<hr />
			@foreach($cases as $case)
			<div class="media">
				<a class="pull-left" href="{{ URL('patient/patient/'.$patient->id.'/case/'.$case->id.'/edit')}}">
					<img class="media-object" src="{{ App\PictureInfo::cover($case->id)}}" width="180px" height="140px" alt="No photo yet">
				</a>
				<div class="media-body">
					<h4 class="media-heading">
						<strong>Created:</strong><span>{{ $case->created_at}}</span>
					</h4>
					<div style="padding-top: 10px;">
						<strong>Case Description:</strong>{{ $case->description }}
					</div>
					<div style="padding-top: 50px;">
						<form action="{{ URL('case/info/'.$case->id )}}" method="POST" style="display:inline">
							<input type="hidden" name="_token" value="{{ csrf_token()}}">
							<input type="hidden" name="_method" value="DELETE">
							<button type="submit" class="btn btn-danger">
								Delete
							</button>
						</form>
						<a href="{{ URL('patient/patient/'.$patient->id.'/case/'.$case->id.'/edit')}}"  class="btn btn-large btn-success">
							Edit
						</a>
					</div>
				</div>
			</div>
			<hr />
			@endforeach
			{!! $cases->render()!!}
		</div>
	</div>
</section>
@endsection
@section('css')
@endsection
@section('js')
<script type="text/javascript">$(".datepicker").datepicker();
$(function() {
	$('a.lightbox').lightBox();
});</script>
@endsection
